import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _omit from "lodash/omit";
var _excluded = ["contextProvider", "form"];

var _dec, _class;

/**
 * EditableRow - 角色管理分配用户明细页面 - 行内编辑行高阶组件
 * @date: 2018-10-26

 */
import React, { Component } from 'react';
import { Form } from 'antd';
var EditableRow = (
/**
 * EditableRow - 送货单创建明细页面 - 行内编辑行高阶组件
 * @extends {PureComponent} - React.PureComponent
 * @reactProps {Object} form - 表单对象
 * @reactProps {object} contextProvider - Context.Provider
 * @return React.element
 */
_dec = Form.create({
  fieldNameProp: null
}), _dec(_class = /*#__PURE__*/function (_Component) {
  _inherits(EditableRow, _Component);

  var _super = _createSuper(EditableRow);

  function EditableRow() {
    _classCallCheck(this, EditableRow);

    return _super.apply(this, arguments);
  }

  _createClass(EditableRow, [{
    key: "componentDidMount",
    value:
    /**
     *
     *
     * @memberof EditableRow
     */
    function componentDidMount() {
      var _this$props$onRef = this.props.onRef,
          onRef = _this$props$onRef === void 0 ? function (e) {
        return e;
      } : _this$props$onRef;
      onRef(this);
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          contextProvider = _this$props.contextProvider,
          form = _this$props.form,
          others = _objectWithoutProperties(_this$props, _excluded);

      var WrapperContextProvider = contextProvider;
      return /*#__PURE__*/React.createElement(WrapperContextProvider, {
        value: form
      }, /*#__PURE__*/React.createElement("tr", _omit(others, ['onRef'])));
    }
  }]);

  return EditableRow;
}(Component)) || _class);
export { EditableRow as default };